export interface FormInstance {
  getFieldsValue: () => Record<string, any>;
  setFieldsValue: (values: Record<string, any>) => void;
  resetFields: () => void;
  validateFields: () => Promise<Record<string, any>>;
}

export interface FormProps {
  form?: FormInstance;
  initialValues?: Record<string, any>;
  onFinish?: (values: Record<string, any>) => void;
  onFinishFailed?: (errors: Record<string, any>) => void;
  children?: React.ReactNode;
}

export interface FormItemProps {
  name: string;
  label?: string;
  rules?: Array<{
    required?: boolean;
    message?: string;
    validator?: (value: any) => boolean | Promise<boolean>;
  }>;
  children?: React.ReactNode;
}

export interface FormContextType {
  formData: Record<string, any>;
  errors: Record<string, string>;
  updateField: (name: string, value: any) => void;
  registerField: (name: string) => void;
  unregisterField: (name: string) => void;
}
